package com.yonyou.cyxdms.sysAuth.service.entity.role;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 角色职责
 * </p>
 *
 * @author 李贺
 * @since 2019-09-18
 */
@TableName("tr_role_position")
public class RolePositionPO extends DMSBasePO<RolePositionPO> {

    private static final long serialVersionUID = 1L;

    /**
     * EMPLOYEE_ROLE_ID
     */
    @TableId(value = "ROLE_POSITION_ID", type = IdType.AUTO)
    private Integer rolePositionId;
    /**
     * 是否销售顾问,是否试车员,是否服务顾问,是否技师,是否可以领料,是否检验员,是否保险专员,是否续保专员,是否定保专员,是否装潢专员,是否DCRC专员
     */
    @TableField("POSITION_CODE")
    private Integer positionCode;
    @TableField("ROLE_ID")
    private Long roleId;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public RolePositionPO() {
        super();
    }

    public Integer getRolePositionId() {
        return rolePositionId;
    }

    public void setRolePositionId(Integer rolePositionId) {
        this.rolePositionId = rolePositionId;
    }

    public Integer getPositionCode() {
        return positionCode;
    }

    public void setPositionCode(Integer positionCode) {
        this.positionCode = positionCode;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.rolePositionId;
    }

    @Override
    public String toString() {
        return "RolePositionPO{" +
                "rolePositionId=" + rolePositionId +
                ", positionCode=" + positionCode +
                ", roleId=" + roleId +
                ", isDeleted=" + isDeleted +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author 李贺
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "rolePositionId");
    }


}
